<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<div class="wrapper">
<div class="delete">
<div align="center">
  <h2>Customer Info  </h2>
  <h2 align="center">Do You want to Delete this Customer!!!</h2>
</div>

<form action="deleted.php" method="post" >
<?php
$account = $_POST["accountNum"];
	$flag=0;
	include 'connect.php';
	$result = mysql_query("SELECT * FROM  accountinfo ORDER BY accountnum");	
	if($account=="")
	{
		?><div align="center"><h1><?php echo "Enter Something to Search!!!";?></h1></div>
	<?php
}
	else
	{	?><table border="0" height="200px;" width="450px;"><?php
		while($row = mysql_fetch_array($result))
  		{
  			if($account==$row['accountnum'])
			{

?>
  <table width="100%" border="0" cellspacing="5" cellpadding="5">
      <tr>
        <td colspan="2"><h2 align="center">Personal Info  </h2></td>
   	<tr>
        <td width="50%"><div align="right">Account No </div></td>
        <td width="50%"><label>
          <input type="text" name="accountnumber" value=<?php echo $row['accountnum']; ?>>
        </label></td>
      </tr>
    <tr>
      <td width="525"><div align="right">First Name </div></td>
      <td width="528"><label>
        <input type="text" name="firstname" id="firstname" value=<?php echo $row['firstname']; ?>>
      </label></td>
    </tr>
    <tr>
      <td><div align="right">Last Name</div></td>
      <td><input name="lastname" type="text" id="lastname" value=<?php echo $row['lastname']; ?>></td>
    </tr>
    <tr>
      <td><div align="right">Address</div></td>
      <td><input type="text" name="address" id="address" value=<?php echo $row['address']; ?>></td>
    </tr>
    <tr>
      <td><div align="right">Phone No</div></td>
      <td><input type="text" name="phone" id="phone" value=<?php echo $row['phoneno']; ?>></td>
    </tr>
    <tr>
      <td><div align="right">NIC </div></td>
      <td><input type="text" name="nic" id="nic" value=<?php echo $row['nic']; ?>></td>
    </tr>
    <tr>
      <td><div align="right">Item </div></td>
      <td><input type="text" name="item" id="item" value=<?php echo $row['item']; ?>></td>
    </tr>
    <tr>
      <td colspan="2"><div align="center">
        <h2>Reference Detail</h2>
      </div></td>
    </tr>
    <tr>
      <td><div align="right">First Name</div></td>
      <td><input type="text" name="reffirstname" id="reffirstname" value=<?php echo $row['ref_firstname']; ?>></td>
    </tr>
    <tr>
      <td><div align="right">Last Name</div></td>
      <td><input type="text" name="reflastname" id="reflastname" value=<?php echo $row['ref_lastname']; ?>></td>
    </tr>
    <tr>
      <td><div align="right">Address</div></td>
      <td><input type="text" name="refaddress" id="refaddress" value=<?php echo $row['ref_address']; ?>></td>
    </tr>
    <tr>
      <td><div align="right">Phone No.</div></td>
      <td><input type="text" name="refphone" id="refphone" value=<?php echo $row['ref_phoneno']; ?>></td>
    </tr>
    <tr>
      <td><div align="right">NIC </div></td>
      <td><input type="text" name="refnic" id="refnic" value=<?php echo $row['ref_nic']; ?>></td>
    </tr>
    
  <td colspan="2"><div align="center">
        <h2>Account Information</h2>
      </div></td>
    <tr>
      <td width="525"><div align="right">Original Amount</div></td>
      <td width="528"><label>
        <input type="text" name="originalamount" id="originalamount" value=<?php echo $row['originalamount']; ?>>
      </label></td>
    </tr>
    <tr>
      <td><div align="right">Profit Percentage       
      </div>        
        <label>
        <div align="right"></div>
      </label></td>
      <td><label>
          <input type="text" name="profit" id="profit" value=<?php echo $row['profit']; ?>>
      </label></td>
    </tr>
    <tr>
      <td><div align="right">Tolal Amount</div></td>
      <td><label>
        <input type="text" name="totalamount" id="totalamount" value=<?php echo $row['totalamount']; ?>>
      </label></td>
    </tr>
    <tr>
      <td><div align="right">Advance</div></td>
      <td><label>
        <input type="text" name="advance" id="advance" value=<?php echo $row['advance']; ?>>
      </label></td>
    </tr>
    <tr>
      <td><div align="right">Remaining</div></td>
      <td><label>
        <input type="text" name="remaining" id="remaining" value=<?php echo $row['remaining']; ?>>
      </label></td>
    </tr>
    <tr>
      <td><div align="right">Installment / Month</div></td>
      <td><label>
        <input type="text" name="installmentpermonth" id="installmentpermonth" value=<?php echo $row['installments']; ?>>
      </label></td>
    </tr>
    <tr>
      <td><label>
          <div align="right">
            <input type="submit" name="Submit2" id="Submit2" value="Delete" />
          </div>
        <div align="right"></div>
        <div align="right"></div>
        </label></td>
    <td><label>
          <div align="left">
            <input type="reset" name="button" id="button2" value="Reset" />
          
          </div>
          
  </table>
        </label></td>
    </tr>
  <p>&nbsp;</p>
  <p><a href="manageCustomer.php">Back to Manage Customer Menu</a></p>
  <?php
				break;
				//header("Location: php/admin.php");
			}
			if($flag==1)
				break;
  		}

	}
	mysql_close($con);
	?>
 
</form>
<p>&nbsp;</p>
</body>
</html>
